{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\n",
      "  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\n"
     ]
    }
   ],
   "source": [
    "\"\"\"\n",
    "Let's get friendly with MNIST\n",
    "author zhenlei Xu(hadxu123@gmail.com)\n",
    "\"\"\"\n",
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "import matplotlib.pyplot as plt\n",
    "from tensorflow.examples.tutorials.mnist import input_data\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.\n",
      "Extracting data/train-images-idx3-ubyte.gz\n",
      "Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.\n",
      "Extracting data/train-labels-idx1-ubyte.gz\n",
      "Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.\n",
      "Extracting data/t10k-images-idx3-ubyte.gz\n",
      "Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.\n",
      "Extracting data/t10k-labels-idx1-ubyte.gz\n",
      "<class 'tensorflow.contrib.learn.python.learn.datasets.mnist.DataSets'>\n",
      "55000\n",
      "10000\n"
     ]
    }
   ],
   "source": [
    "##Download and Extract MNIST dataset\n",
    "mnist = input_data.read_data_sets('data/',one_hot=True)\n",
    "print type(mnist)\n",
    "print mnist.train.num_examples\n",
    "print mnist.test.num_examples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "What does the data look like?\n",
      "<type 'numpy.ndarray'>\n",
      "<type 'numpy.ndarray'>\n",
      "<type 'numpy.ndarray'>\n",
      "<type 'numpy.ndarray'>\n",
      "(55000, 784)\n",
      "(55000, 10)\n",
      "(10000, 784)\n",
      "(10000, 10)\n"
     ]
    }
   ],
   "source": [
    "print 'What does the data look like?'\n",
    "trainimg = mnist.train.images\n",
    "trainlabel = mnist.train.labels\n",
    "testimg = mnist.test.images\n",
    "testlabel = mnist.test.labels\n",
    "print type(trainimg)\n",
    "print type(trainlabel)\n",
    "print type(testimg)\n",
    "print type(testlabel)\n",
    "print trainimg.shape\n",
    "print trainlabel.shape\n",
    "print testimg.shape\n",
    "print testlabel.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "How does the training data look like?\n",
      "32662th training datalabel is 5\n",
      "4940th training datalabel is 4\n",
      "52297th training datalabel is 6\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP4AAAEHCAYAAACOfPs0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFB1JREFUeJzt3XuUXWV9xvHvExLUEISUwgSIJoKXuEJnRUQqAouLSxAU\nQRBCYa0C0kiVIpa2iBQbLReNdaFIgVUhYgC5BBY3W0M0FQsUFSIgQRAQCJFLJiGMEKoQdH79Y7+T\nnAzn7DMz5zq8z2ets+ac/dt7n/fsOc++vXvPKCIws7yM63QDzKz9HHyzDDn4Zhly8M0y5OCbZcjB\nN8uQg98ikgYk7dDG99tD0kPNHrdRkuZKurxF8z5G0u2tbkfZtO1cls00poIv6XJJz0h6QdKvJR1f\nUftLST+UtEZSn6RrJE0ZMv3Okv5H0lpJz0o6aUj9ZEmPS3pJ0q8kvT0NP1DS7ZL60/t/W9Kkiulu\nlfTJIc0d9gUS6Yt12YgWxtA3i7gjIt7d7HGbZFjLQtKlkv61FfMexbjDmna0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3w/vpmt\n5+CbZcjBN8uQg2+WIQffLEMOvlmGHHyzDDn4Zhly8M0y5OCbZcjBN8uQg2+WIQffLEMOvlmGHHyz\nDDn4Zhlq+R/iMLPu4y2+WYYcfLMMOfhmGXLwzTLk4Jtl6P8BVLtGYleUQRUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f69d7a0c150>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP4AAAEHCAYAAACOfPs0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE/dJREFUeJzt3Xu0XHV5xvHvQ2IACZcUJFwCAVMVgWJaoktAkFQM2mUb\noIoItUAqolCRqkWMllQERSqpiHW1knDLMiKgNFgsoKJBFqCAiU0EBS/hIJCTEAIk3CVv/9i/EybD\nzJ5zMrPnzMnv+ax1Vubsd+/Z7+wzz+x7RhGBmeVls+FuwMy6z8E3y5CDb5YhB98sQw6+WYYcfLMM\nOfgdImmdpFd3cX5vkXRvp8dtl6RZkuZV9NzHS/pJ1X2UTdvNZVmlTSL4kl4j6RlJV9QN/7SkByQ9\nLmm+pLENph0naaWkW+qGv03SvZLWSvqhpN1raj+SNKPuqQZ9QUR6Y13ReszmIuLWiHh9p8ftkEEt\nC0mXSjq7iufeiHEHNW27y1LSK9L7qm/jW2vfJhF84KvAz2oHSDoeOA44ANgFeGUar94XgV/WTbs9\n8G3g08CfAHcD32rRgzam8aZPJnX0+axnnAH0D3cTIz74ko4BVgM/rCu9C5gbEQ9HxNMUAT9a0hY1\n0x4I7ANcWjftUcDSiPhORDwP/Cuwn6TXSjoHOBj4qqQnJX2lZrq3S7pP0mOSGn3IIOlwYCbwXklr\nJC1Kw38k6RxJt0p6CthT0gmS7knz+Y2kD9Y8z1slPVjz++8lfVzSLyStlvRNSWOGOm6qnyHpYUl/\nkPQPZbsxkvaQ9GNJT0i6Edihrn6Vp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gQf1EZtabBnM67yDgOGCJpEUUm/Qz\ngS8CV0maATwAlP8/zWbWM9Tq+83bnoHkff8KTZkypbR+2223ldZHjy7/7J8xY0Zp/bLLLiut2/CK\nCDUa7iv3zDLk4JtlyME3y5CDb5YhB98sQw6+WYYcfLMM+f/VH+FmzpxZWh81alRp/b777iutt/p/\n821k8hrfLEMOvlmGHHyzDDn4Zhly8M0y5OCbZcjBN8uQz+P3uP3337+0fuihh5bWn3766dL6tGnT\nSuvPP/98ad1GJq/xzTLk4JtlyME3y5CDb5YhB98sQw6+WYYcfLMM+Tx+j7vgggtK69tuu21p/aqr\nriqt9/X1DbknG/m8xjfLkINvliEH3yxDDr5Zhhx8sww5+GYZcvDNMqSI8q+vlzQBuAIYD6wDvh4R\nF0maBZwErEijzoyIGxpMXz4DK7Vu3brSequ/3y677FJa7+/vH3JPNnJEhBoNH8wFPH8EPhYRiyWN\nBe6W9P1Umx0RszvVpJl1R8vgR8RyYHl6vFbSvcCuqdzw08TMetuQ9vEl7QFMBn6aBp0qabGkOZLK\nrx01s54x6OCnzfxrgI9GxFrga8CkiJhMsUXgTX6zEWJQwZc0miL08yJiAUBErIyXjixdDLyxmhbN\nrNMGu8a/BLgnIi4cGCBpp5r6UcDSTjZmZtVpeXBP0kHAccASSYuAAGYCx0qaTHGKbxlwcoV9mlkH\ntTyP3/YMfB7fbNg0O4/vK/fMMuTgm2XIwTfLkINvliEH3yxDDr5Zhhx8sww5+GYZcvDNMuTgm2XI\nwTfLkINvliEH3yxDDr5Zhhx8sww5+GYZqvw/4jCz3uM1vlmGHHyzDDn4Zhly8M0y5OCbZej/AQ2x\nyqB0cb6gAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f69d7dee8d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP4AAAEHCAYAAACOfPs0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\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"metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# How does the training data look like?\n",
    "print \"How does the training data look like?\"\n",
    "nsample = 3\n",
    "randidx = np.random.randint(trainimg.shape[0],size = nsample)\n",
    "for i in randidx:\n",
    "    curr_img = np.reshape(trainimg[i,:],(28,28))\n",
    "    curr_label = np.argmax(trainlabel[i,:])\n",
    "    plt.matshow(curr_img,cmap=plt.get_cmap('gray'))\n",
    "    plt.title(\"\"+str(i)+\"th training data\"+\"label is \"+str(curr_label))\n",
    "    print \"\"+str(i)+\"th training data\"+\"label is \"+str(curr_label)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\"\"\"\n",
    "Batch Learning\n",
    "\"\"\"\n",
    "batch_size = 100\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11+"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
